package com.mcc.myapplication

/**
 * try {
 *     // 一些代码
 * } catch (e: SomeException) {
 *     // 处理程序
 * } finally {
 *     // 可选的 finally 块
 * }
 */

fun fail(message: String): Nothing {
    throw IllegalArgumentException(message)
}

fun main(){
    val input = "2"
    val a: Int? = try { input.toInt() } catch (e: NumberFormatException) { null }
}